package com.dao.impl;

import java.util.List;

import com.dao.SuperTypeDao;
import com.model.SuperType;

public class SuperTypeDaoImpl extends BaseDao implements SuperTypeDao {

	public int insert(SuperType spt) {
		String sql = "insert into tb_superType (typename) values(?)";
		Object[] params = { spt.getTypeName() };
		return super.excecuteUpdate(sql, params);
	}

	@Override
	public List<SuperType> queryAllSuperType() {
		String sql = "select * from tb_superType";
		return super.getEntityList(sql, null, SuperType.class);
	}

	@Override
	public SuperType querySuperTypeByName(String typename) {
		String sql = "select * from tb_superType where typeName=?";
		Object[] params={typename};
		return super.getOneEntity(sql, params, SuperType.class);
	}

	@Override
	public int deleteSupperbTypeByIds(String superTypeId) {
		String sql="delete from tb_superType where id in (?)";
		Object[] params={superTypeId};
		return super.excecuteUpdate(sql, params);
	}

}
